package spring.security.oauth2.controller;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: chenzekai
 * @create: 2020/05/20
 **/
@RestController
@RequestMapping("/user")
public class UserController {

    @GetMapping("/getHead")
    public String getHead(){
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        return "获取用户头像";
    }

    @GetMapping("/getName")
    public String getMessage(){
        return "获取用户姓名";
    }

    @GetMapping("/getPhone")
    public String getPhone(){
        return "获取用户电话";
    }
}
